<!DOCTYPE html>
<html lang="en">
<head>
    <script src="js/jquery-1.11.0.min.js"></script>
    <meta charset="UTF-8">
    <title>充值</title>
</head>
<body>
<form ACTION="recharge">
    选择一类卡号 <select id="card_num">
</select>
    <SPAN id="se" style="color: red"></SPAN>
    <br>
    输入充值金额 <input type="text"  id="money" ><SPAN id="see" style="color: red" ></SPAN>
    <br>
    <input type="button" value="充值" id="recharge" >
</form>
</body>
<script>
    $(function (){
        $("#recharge").click(function () {
            let cardNum = $("#card_num").val();
            let  money = $("#money").val();

            $.post("recharge",{"card_num":card_num,"money":money},function (data){
                if (data=='false'){
                    alert("充值失败")
                }
                if (data=='true'){
                    flag = confirm("充值成功，是否返回登录页面？");
                    if (flag){
                        window.location.href="succeed.html"
                    }
                }


                $("#se").html("");
                $("#see").html("");
            });
        });
    });


</script>
</html>